# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.utils import shell


class Recipe(recipe.Recipe):
    name = 'wavpack'
    version = '5.0.0'
    stype = SourceType.TARBALL
    url = 'https://github.com/dbry/WavPack/archive/5.0.0.tar.gz'
    tarball_dirname = 'WavPack-%(version)s'
    licenses = [License.BSD_like]
    autoreconf = True
    configure_options = ' --disable-apps '

    files_libs = ['libwavpack']
    files_devel = ['include/wavpack', 'lib/pkgconfig/wavpack.pc']

    def configure(self):
        shell.replace(os.path.join(self.build_dir, 'Makefile.am'),
            {'SUBDIRS = src include cli man': 'SUBDIRS = src include man'})
        if self.config.target_arch not in [Architecture.X86, Architecture.X86_64, Architecture.ARMv7, Architecture.ARMv7S] or self.config.target_platform == Platform.IOS:
            self.configure_options += ' --disable-asm '

        super(Recipe, self).configure()

